feat: add dark/light mode toggle with localStorage persistence#209
feat: add dark/light mode toggle with localStorage persistence#209shubh22-u wants to merge 4 commits into
Conversation
|
@shubh22-u is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
komalharshita
left a comment
There was a problem hiding this comment.
Thanks for contributing a dark/light mode feature for DevPath. The implementation direction is good overall, and I appreciate the use of localStorage persistence and CSS variables. However, after a detailed review, there are several important issues that should be addressed before this can be merged.
Main concerns
The dark mode token system is incomplete and currently overrides only a subset of the existing design variables, which can lead to inconsistent UI states across components.
The implementation does not support prefers-color-scheme, so system theme preferences are ignored.
Theme initialization happens after render, which may cause a flash of incorrect theme (FOUC).
Accessibility is incomplete — the toggle should also update aria-pressed state dynamically.
The current emoji-based icon approach is inconsistent across platforms and would be better replaced with SVG icons.
Mobile navigation does not appear to include theme toggle support.
Since this PR changes global styles, the full UI should be verified across:
forms
recommendation cards
dropdowns
buttons
loading states
mobile layouts
footer/components
The PR currently has merge conflicts and needs to be rebased against the latest main branch before further review.
Please resolve the merge conflicts, retest the UI thoroughly, and improve the theme architecture/accessibility before this can be considered for merge.
|
Closing this PR for inactivity |
Summary [required]
This PR adds a Dark/Light mode toggle to the DevPath website.
The site previously had no theme switching option, which caused
eye strain for users browsing in low-light environments. A toggle
button (🌙/☀️) has been added to the navbar that smoothly switches
between dark and light themes, and the user's preference is saved
using localStorage so it persists across page refreshes.
Related Issue [required]
Closes #187
Type of Change [required]
What Was Changed [required]
templates/index.htmlstatic/style.cssstatic/script.jsHow to Test This PR [required]
git checkout feat/dark-light-modepip install -r requirements.txtpython app.pypython tests/test_basic.pyExpected test output:
Test Results [required]
This is a frontend-only change (HTML, CSS, JS).
No Python logic was modified. All existing tests pass as no
backend code was changed.
Screenshots (if UI change)
Self-Review Checklist [required]
feat/dark-light-modeprint()orconsole.log()debug statementsNotes for Reviewer
The toggle button is placed in the navbar for easy access on all pages.
CSS variables are used for clean theme switching without overriding
existing styles. localStorage ensures the user preference is remembered
across sessions. Please test on both mobile and desktop views.
Closes #<187>
Added dark/light mode toggle button in navbar.
Changes made: